package me.apidemo.a02bigintegerdemo;

import java.math.BigInteger;
import java.util.Random;

public class BigIntegerDemo1 {
    public static void main(String[] args) {
        //获取随机的大整数
        Random r = new Random();
        for (int i = 0; i < 10; i++) {
            BigInteger bd1 = new BigInteger(4,r);
            System.out.println(bd1);
        }
        //获取指定的大整数
        BigInteger bd2 = new BigInteger("1000");
        System.out.println(bd2);

        //静态方法获取BigInteger的对象，有优化
        BigInteger bd3 = BigInteger.valueOf(16);
        System.out.println(bd3);
    }
}
